package com.htthorizon.powersupply.controller;

import com.htthorizon.powersupply.service.RealTimePowerOutageService;
import com.htthorizon.powersupply.utils.R;
import com.htthorizon.powersupply.vo.RealTimePowerOutageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Brilliant
 */
@RestController
@RequestMapping("/realTimePowerOutage")
public class RealTimePowerOutageController {

    @Autowired
    private RealTimePowerOutageService realTimePowerOutageService;

    @GetMapping("/lineOutageStatistics")
    public R<List<RealTimePowerOutageVo>> lineOutageStatistics(){
        List<RealTimePowerOutageVo> list=  realTimePowerOutageService.getLineOutageStatistics();
        return R.ok(list);
    }
}
